#include<bits/stdc++.h>
using namespace std;

int cnt[10];

int main()
{
	string num;
	cin>>num;
	for(auto i:num)
		cnt[i-'0']++;
	
	string left;
	for(int i = 9;i >= 0;i--)
	{
		while(cnt[i] >= 2)
		{
			left += to_string(i);
			cnt[i] -= 2;
		}
	}
	
	string right = left;
	reverse(right.begin(), right.end());
	
	for(int i = 9;i >= 0;i--)
	{
		if(cnt[i])
		{
			left += to_string(i);
			break;
		}
	}
	
	cout<<left+right;
	return 0;
}

